package cn.seaboot.flake.entity;


import javax.persistence.Column;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Map;

/**
 * POJO
 * 数据库列映射 [t_db_mapping_column]
 *
 * @author ChenSS on 2018/4/28.
 */
public class MappingColumn implements Serializable {
    private static final long serialVersionUID = 4016685929142305024L;
    /**
     * 数据库名
     */@Column
    private String schemaName;
    /**
     * 表名
     */
    private String tableName;
    /**
     * 列名
     */
    private String columnName;
    /**
     * 驼峰式命名
     */
    private String camelName;
    /**
     * 帕斯卡命名
     */
    private String pascalName;
    /**
     * 超类
     */
    private String superType;
    /**
     * 列类型
     */
    private String columnType;
    /**
     * Jdbc类型
     */
    private String jdbcType;
    /**
     * Java类型
     */
    private String javaType;
    /**
     * 中文描述
     */
    private String columnComment;
    /**
     * 字符串长度
     */
    private BigInteger length;
    /**
     * 小数长度
     */
    private Integer numericScale;
    /**
     * 整数长度
     */
    private Integer numericPrecision;
    /**
     * 默认值
     */
    private String defaultValue;
    /**
     * 是否允许为空
     */
    private Boolean nullable;
    /**
     * 是否必填
     */
    private Boolean require;
    /**
     * 字段顺序
     */
    private Integer ordinalPosition;
    /**
     * 额外的数据
     */
    private Map<String, Object> attach;

    public String getSchemaName() {
        return schemaName;
    }

    public void setSchemaName(String schemaName) {
        this.schemaName = schemaName;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getcamelName() {
        return camelName;
    }

    public void setcamelName(String camelName) {
        this.camelName = camelName;
    }

    public String getpascalName() {
        return pascalName;
    }

    public void setpascalName(String pascalName) {
        this.pascalName = pascalName;
    }

    public String getSuperType() {
        return superType;
    }

    public void setSuperType(String superType) {
        this.superType = superType;
    }

    public String getColumnType() {
        return columnType;
    }

    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }

    public String getJdbcType() {
        return jdbcType;
    }

    public void setJdbcType(String jdbcType) {
        this.jdbcType = jdbcType;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public String getColumnComment() {
        return columnComment;
    }

    public void setColumnComment(String columnComment) {
        this.columnComment = columnComment;
    }

    public BigInteger getLength() {
        return length;
    }

    public void setLength(BigInteger length) {
        this.length = length;
    }

    public Integer getNumericScale() {
        return numericScale;
    }

    public void setNumericScale(Integer numericScale) {
        this.numericScale = numericScale;
    }

    public Integer getNumericPrecision() {
        return numericPrecision;
    }

    public void setNumericPrecision(Integer numericPrecision) {
        this.numericPrecision = numericPrecision;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public Boolean getNullable() {
        return nullable;
    }

    public void setNullable(Boolean nullable) {
        this.nullable = nullable;
    }

    public Boolean getRequire() {
        return require;
    }

    public void setRequire(Boolean require) {
        this.require = require;
    }

    public Integer getOrdinalPosition() {
        return ordinalPosition;
    }

    public void setOrdinalPosition(Integer ordinalPosition) {
        this.ordinalPosition = ordinalPosition;
    }

    public Map<String, Object> getAttach() {
        return attach;
    }

    public void setAttach(Map<String, Object> attach) {
        this.attach = attach;
    }

    @Override
    public String toString() {
        return "MappingColumn{" +
                "schemaName='" + schemaName + '\'' +
                ", tableName='" + tableName + '\'' +
                ", columnName='" + columnName + '\'' +
                ", camelName='" + camelName + '\'' +
                ", pascalName='" + pascalName + '\'' +
                ", superType='" + superType + '\'' +
                ", columnType='" + columnType + '\'' +
                ", jdbcType='" + jdbcType + '\'' +
                ", javaType='" + javaType + '\'' +
                ", columnComment='" + columnComment + '\'' +
                ", length=" + length +
                ", numericScale=" + numericScale +
                ", numericPrecision=" + numericPrecision +
                ", defaultValue='" + defaultValue + '\'' +
                ", nullable=" + nullable +
                ", require=" + require +
                ", ordinalPosition='" + ordinalPosition + '\'' +
                ", attach=" + attach +
                '}';
    }
}
